<!DOCTYPE HTML>
<html>
<head>
    <meta charset="utf-8">
    <meta name="renderer" content="webkit|ie-comp|ie-stand">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
    <meta http-equiv="Cache-Control" content="no-siteapp" />
    <!--[if lt IE 9]>
    <script type="text/javascript" src="../../lib/html5shiv.js?rev=@@hash"></script>
    <script type="text/javascript" src="../../lib/respond.min.js?rev=@@hash"></script>
    <![endif]-->
    <link rel="stylesheet" type="text/css" href="../../static/h-ui/css/H-ui.min.css" />
    <link rel="stylesheet" type="text/css" href="../../static/h-ui.admin/css/H-ui.admin.css" />
    <link rel="stylesheet" type="text/css" href="../../lib/Hui-iconfont/1.0.8/iconfont.css" />
    <link rel="stylesheet" type="text/css" href="../../static/h-ui.admin/skin/default/skin.css" id="skin" />
    <link rel="stylesheet" type="text/css" href="../../static/h-ui.admin/css/style.css" />
    <link rel="stylesheet" type="text/css" href="../../lib/Validform/5.3.2/style.css" />
    <link rel="stylesheet" type="text/css" href="../../ht-css/style-q.css" />
    <link rel="stylesheet" type="text/css" href="../../ht-css/Project.css" />
    <link rel="stylesheet" type="text/css" href="../../ht-css/jedate.css" />
    <!--[if IE 6]>
    <script type="text/javascript" src="../../lib/DD_belatedPNG_0.0.8a-min.js?rev=@@hash"></script>
    <script>DD_belatedPNG.fix('*');</script>
    <![endif]-->
    <title>发货仓</title>
</head>
<body data-id="44">
<nav class="breadcrumb"><i class="Hui-iconfont">&#xe67f;</i> 首页  <span class="c-gray en">&gt;</span>库存管理<a class="btn btn-success radius r" style="line-height:1.6em;margin-top:3px" href="javascript:location.replace(location.href);" title="刷新" ><i class="Hui-iconfont">&#xe68f;</i></a></nav>
<article class="page-container">
    <div class="ml-20 mr-20">
        <div class="bg-1 bk-gray pb-10">
            <form class="lh-20 pd-10 classForm" id="form-search">
                <div class="pl-10 lh-30 mb-10 ml-20 mt-10">
                    <ul style="overflow: hidden;">
                        <li class="f-l mr-20"><i class="Hui-iconfont f-16" style="color:#4A90E2;">&#xe671;</i><strong class="f-14 ml-5">区域</strong></li>
                        <li class="f-l mr-40"><strong class="f-16" id="city_name" >京南仓</strong></li>
                        <li class="f-l"><a class="switch_city" style="color:#1476E5;">切换</a></li>
                        <div class="ulselect" style="display: none;">
                        <li class="f-l w-150 ml-40" style="margin-top:2px;">
                            <span style="height:26px;padding:0;" class="select-box size-M radius col-xs-8 lh-26">
                              <select class="select" id="city_select" name="city" size="1">
                                          <script id="ascription_bob" type="text/x-dot-template" >
                                            {{if( it && it.length>0 ){}}
                                            {{ for(var i=0; i< it.length; i++) { }}
                                                {{? i==0 }}
                                                <option selected value="{{=it[i].warehouse_code}}">
                                                    {{=it[i].warehouse_name}}</option>
                                                {{??}}
                                                <option value="{{=it[i].warehouse_code}}">{{=it[i].warehouse_name}}</option>
                                                {{?}}
                                            {{ } }}
                                            {{ }else{ }}
                                            <option>没有数据</option>
                                            {{ } }}
                                        </script>
                               </select>
                            </span>
                        </li>
                            <li class="f-l ml-20">
                                <input type="button" class="btn btn-secondary radius size-S" style="margin-top:-2px;" value="确&nbsp;&nbsp;定" onclick="changeCity()">
                                <input type="reset" class="btn radius size-S ml-10" value="取&nbsp;&nbsp;消" onclick="cancelCity()">
                            </li>
                        </div>
                    </ul>
                </div>

                <div class="line mb-10"></div>
                <table class="table-hover table_li ml-10 mb-10 table">
                    <thead class="text-l">
                    <tr>
                        <td class="col-5-4" colspan="4">
                            <div class="row ml-10">
                                <label class="form-label f-l label-4">品类名称：</label>
                                <div class="f-l category_select_box"></div>
                                <!--<span class="size-M radius col-xs-8 f-l" style="width:15%">
                                    <div style="position: relative;z-index: 900;">
                                        <input type="text" autocomplete="off" class="input-text radius" name="class1" placeholder="请选择一级品类" oninput="goods_listCategory(1)" id="class1" datatype="/^[、a-zA-Z0-9\u4e00-\u9fa5]{0,20}$/" errormsg="格式错误，请重新输入" ignore="ignore">
                                        <ul class="relation radius guanlian" id="classUl1"></ul>
                                    </div>
                                    <span class="Validform_checktip"></span>
                                </span>
                                <span class="f-l pl-10 pr-10 pt-5">~</span>
                                <span class="size-M radius col-xs-8 f-l" style="width:15%">
                                    <div style="position: relative;z-index: 900;">
                                        <input type="text" autocomplete="off" class="input-text radius" name="class2" placeholder="请选择二级品类" id="class2" datatype="*0-20" errormsg="格式错误，请重新输入" ignore="ignore">
                                        <ul class="relation radius guanlian" id="classUl2"></ul>
                                    </div>
                                    <span class="Validform_checktip"></span>
                                </span>
                                <span class="f-l pl-10 pr-10 pt-5">~</span>
                                <span class="size-M radius col-xs-8" style="width:15%">
                                    <div style="position: relative;z-index: 900;">
                                        <input type="text" autocomplete="off" class="input-text radius" name="class3" placeholder="请选择三级品类" id="class3" datatype="*0-20" errormsg="格式错误，请重新输入" ignore="ignore">
                                        <ul class="relation radius guanlian" id="classUl3"></ul>
                                    </div>
                                    <span class="Validform_checktip"></span>
                                </span>
                                <span class="f-l pl-10 pr-10 pt-5">~</span>
                                <span class="size-M radius col-xs-8" style="width:20%">
                                    <div style="position: relative;z-index: 900;">
                                        <input type="text" autocomplete="off" class="input-text radius" name="class4" placeholder="请选择四级品类" id="class4" datatype="*0-20" errormsg="格式错误，请重新输入" ignore="ignore">
                                        <ul class="relation radius guanlian" id="classUl4"></ul>
                                    </div>
                                    <span class="Validform_checktip"></span>
                                </span>-->
                            </div>
                        </td>
                    </tr>
                    <tr>
                        <td class="col-5-1">
                            <div class="row ml-10">
                                <label class="form-label f-l text-r w-60 lh-26">SPU码：</label>
                                <div class="formControls f-l">
                                    <input type="text" class="input-text radius w-130" name="spu_code" id="spu_code" placeholder="输入SPU码" datatype="/^[0-9]{0,11}$/" errormsg="格式错误，请重新输入" ignore="ignore">
                                </div>
                                <span class="Validform_checktip"></span>
                            </div>
                        </td>
                        <td class="col-5-1">
                            <div class="row ml-10">
                                <label class="form-label f-l text-r w-60 lh-26">Code码：</label>
                                <div class="formControls f-l">
                                    <input type="text" class="input-text radius w-130" name="sku_code" id="sku_code" placeholder="输入Code码"  datatype="*0-15" errormsg="格式错误，请重新输入" ignore="ignore">
                                </div>
                                <span class="Validform_checktip"></span>
                            </div>
                        </td>
                        <td class="col-5-1">
                            <div class="row ml-10 cl">
                                <label class="form-label f-l text-r w-60 lh-26">商品名称：</label>
                                <div class="formControls f-l col-8" style="padding-left:0px">
                                    <input type="text" class="input-text radius" name="goodsName" id="goodsName" placeholder="输入商品名称关键字" datatype="/^[a-zA-Z0-9\u4e00-\u9fa5\W]{0,20}$/" errormsg="格式错误，请重新输入" ignore="ignore">
                                </div>
                                <span class="Validform_checktip"></span>
                            </div>
                        </td>
                        <td class="col-5-1">
                            <div class="row ml-10">
                                <label class="form-label f-l text-r w-60 lh-26">品牌：</label>
                                <div class="formControls f-l">
                                    <input type="text" class="input-text radius w-130" name="brandParam"  id="brandParam" placeholder="输入品牌关键字" datatype="/^[a-zA-Z0-9\u4e00-\u9fa5]{0,15}$/" errormsg="格式错误，请重新输入" ignore="ignore">
                                </div>
                                <span class="Validform_checktip"></span>
                            </div>
                        </td>
                    </tr>
                    </thead>
                </table>
                <div class="text-c mb-10">
                    <input type="submit" class="btn btn-secondary radius size-S powerButton 1000001954909102" value="查&nbsp;&nbsp;询">
                    <input name="form1" type="reset" onclick="resetDiv()" class="btn radius size-S ml-10 powerButton 1000001954909102"
                           value="重&nbsp;&nbsp;置">
                </div>
            </form>
            <table class="table table-border table-bg table-hover table-sort mt-10" id="datatable">
                <thead>
                <tr class="text-c">
                    <th>Code码</th>
                    <th>图片</th>
                    <th>商品名称</th>
                    <th>规格属性</th>
                    <th>品牌</th>
                    <th>可用库存</th>
                    <th>可超卖库存</th>
                    <th>总超卖库存</th>
                    <th>存量属性</th>
                    <th>库存上限</th>
                    <th>到货周期</th>
                </tr>
                </thead>
                <tbody class="shun">
                </tbody>
            </table>
            <div class="dataTables_wrapper goods_fanye clearfix mt-5">
                <div class="f-r pageturning M-box3"></div>
            </div>
        </div>
    </div>
</article>
<!--_footer 作为公共模版分离出去-->
<script type="text/javascript" src="../../lib/jquery/1.9.1/jquery.min.js?rev=@@hash"></script>
<script type="text/javascript" src="../../lib/layer/2.4/layer.js?rev=@@hash"></script>
<script type="text/javascript" src="../../static/h-ui/js/H-ui.min.js?rev=@@hash"></script>
<script type="text/javascript" src="../../static/h-ui.admin/js/H-ui.admin.js?rev=@@hash"></script> <!--/_footer 作为公共模版分离出去-->
<!--请在下方写此页面业务相关的脚本-->
<script type="text/javascript" src="../../lib/jquery.jedate.min.js?rev=@@hash"></script>
<!--表单验证-->
<script type="text/javascript" src="../../lib/jquery.validation/1.14.0/jquery.validate.js?rev=@@hash"></script>
<script type="text/javascript" src="../../lib/jquery.validation/1.14.0/validate-methods.js?rev=@@hash"></script>
<script type="text/javascript" src="../../lib/jquery.validation/1.14.0/messages_zh.js?rev=@@hash"></script>
<script type="text/javascript" src="../../lib/datatables/1.10.0/jquery.dataTables.min.js?rev=@@hash"></script>
<script type="text/javascript" src="../../lib/laypage/1.2/laypage.js?rev=@@hash"></script>
<script type="text/javascript" src="../../lib/Validform/5.3.2/Validform_v5.3.2_min.js?rev=@@hash"></script>
<!--引入分页-->
<link rel="stylesheet" href="../../lib/pagination/pagination.css">
<script src="../../ht-js/frame/doT.min.js?rev=@@hash"></script>
<script src="../../lib/pagination/jquery.pagination.js?rev=@@hash"></script>
<script src="../../ht-js/public.js?rev=@@hash"></script>
<!--验证token-->
<script src="../../ht-js/verifyToken.js?rev=@@hash"></script>
<script src="../../ht-js/commonJs/goodCategorySelect.js?rev=@@hash"></script><!--四级品类联动-->
<script src="../../ht-js/goods/warehouse.js?rev=@@hash"></script>
<script type="text/javascript" src="../../ht-js/power.js?rev=@@hash"></script>
<script>
    /*
下拉框的展示
 */
    var wareList = [],
        cityValue = 1;
    $(function () {
        $.ajax({
            type: "post",
            url: root.publics.getAllWarehouse,
            cache: false,  //禁用缓存
            dataType: "json",
            success: function (data) {
                console.log(data);
                wareList = data.data
                if(data.errorCode=="0") {
                    var dataInter=data.data;
                    var interText = doT.template($("#ascription_bob").text());
                    $("#city_select").html(interText(dataInter));
                }
            }
        })
    })

    //更换区域确定
    function changeCity(){
        console.log($('#city_select').val());
        $.each(wareList,function () {
            if(this.warehouse_code==$('#city_select').val())
            {
                sessionStorage.setItem("wareHouseCode", this.warehouse_code);
                $('#city_name').html(this.warehouse_name);
                cityValue = this.warehouse_code;
            }
        })
        $(".ulselect").hide();
    }
    //更换区域取消
    function cancelCity(){
        $(".ulselect").hide();
    }

    //显示仓库下拉框
    $(function(){
        $(".switch_city").click(function(){
            $(".ulselect").css("display","block");
            $('#city').html($('#city_name').val());
            $("#city_select").val(cityValue)
        })
    });
    /*tab切换*/
    jQuery.Huitab = function (tabBar, tabCon, class_name, tabEvent, i) {
        var $tab_menu = $(tabBar);
        // 初始化操作
        $tab_menu.removeClass(class_name);
        $(tabBar).eq(i).addClass(class_name);
        $(tabCon).hide();
        $(tabCon).eq(i).show();
        $tab_menu.bind(tabEvent, function () {
            $tab_menu.removeClass(class_name);
            $(this).addClass(class_name);
            var index = $tab_menu.index(this);
            $(tabCon).hide();
            $(tabCon).eq(index).show()
        })
    }

    $(function () {
        $.Huitab("#tab_topnav .tabBar span", "#tab_topnav .tabCon", "current", "click", "0")
    });
    $(function () {
        $(".classForm").Validform({
            tiptype: 2,
            callback: function (form) {
                searchStorage();
                return false;
            }
        });
    });

    var pageNum=1;
    function searchStorage(pageNum) {
        console.log(_categoryData);
        let params = {
            firstCategoryId: _categoryData.categoryId1,
            secondCategoryId: _categoryData.categoryId2,
            thirdCategoryId: _categoryData.categoryId3,
            categoryId: _categoryData.categoryId4,
            warehouseCode: cityValue,
            spuCode: $("#spu_code").val(),
            skuCode:$("#sku_code").val(),
            productCode:$("#productCode").val(),
            helpCode:$("#helpCode").val(),
            nameParam :$("#goodsName").val(),
            brandParam: $("#brandParam").val(),
            specifications : $("#specifications ").val(),
            aliasName:$("#aliasParam").val(),
            salesManParam: $("#salesManParam").val(),
            specialTypeId: $(".specialTypeId").val()
        }
        $.ajax({
            contentType: 'application/json',
            url: root.goodsInter.goods_getStockInfo,
            cache: false, //禁用缓存
            type: "POST",
            data: JSON.stringify({
                pageSize: 50,
                nowPage: pageNum,
                model: params //传入组装的参数
            }),
            success: function(data) {
                goodsList(data);
               var  totalPage = data.data.totalPage;
                $('.M-box3').pagination({
                    pageCount: totalPage,
                    jump: true,
                    coping: true,
                    prevContent: '上页',
                    nextContent: '下页',
                    callback: function(api) {
                        console.log(api);
                        $.ajax({
                            contentType: 'application/json',
                            url: root.goodsInter.goods_getStockInfo,
                            cache: false, //禁用缓存
                            type: "POST",
                            data: JSON.stringify({
                                pageSize: 50,
                                nowPage: api.getCurrent(),
                                model: params //传入组装的参数
                            }),
                            success: function(data) {
                                goodsList(data);
                            },
                            error: function(XMLHttpRequest, textStatus, errorThrown) {
                                alert(XMLHttpRequest);
                            }
                        });
                    }
                });
            },
            /*error: function(XMLHttpRequest, textStatus, errorThrown) {
                alert(XMLHttpRequest);
            }*/
        });
    }


</script>
</body>
</html>